Skip to content

Introduce the capability to refresh the dpop proof on a retry#344

Merged
Erwinvandervalk merged 1 commit intomainfrom
fix/dpop-client-assertion-oidc-client
Mar 17, 2026
Merged

Introduce the capability to refresh the dpop proof on a retry#344
Erwinvandervalk merged 1 commit intomainfrom
fix/dpop-client-assertion-oidc-client

Conversation

@Erwinvandervalk
Copy link
Contributor

@Erwinvandervalk Erwinvandervalk commented Mar 16, 2026

Summary

Part 2 of 3 — split from #329. Stacked on #343.

  • Wire client assertion creator into OIDC code exchange flow in OidcClient and ResponseProcessor
  • Update DPoP ProofTokenMessageHandler to regenerate assertions on nonce retry
  • Add ClientAssertionService to NetCoreConsoleClient sample
  • Expand DPoP test coverage for client assertion scenarios

@Erwinvandervalk Erwinvandervalk force-pushed the fix/dpop-client-assertion-oidc-client branch from 6dde893 to a5a4de2 Compare March 16, 2026 06:40
@Erwinvandervalk Erwinvandervalk force-pushed the fix/dpop-client-assertion-identity-model branch from 68933eb to eae9f10 Compare March 16, 2026 13:19
Base automatically changed from fix/dpop-client-assertion-identity-model to main March 16, 2026 13:24
@Erwinvandervalk Erwinvandervalk force-pushed the fix/dpop-client-assertion-oidc-client branch from a5a4de2 to 1758074 Compare March 16, 2026 13:49
Copilot AI review requested due to automatic review settings March 16, 2026 13:49
@Erwinvandervalk Erwinvandervalk force-pushed the fix/dpop-client-assertion-oidc-client branch from 4f69935 to 04a6824 Compare March 16, 2026 13:54
@Erwinvandervalk Erwinvandervalk changed the title Fix stale ClientAssertion on DPoP nonce retry - OidcClient Introduce the capability to refresh the dpop proof on a retry Mar 16, 2026
@Erwinvandervalk Erwinvandervalk force-pushed the fix/dpop-client-assertion-oidc-client branch from 04a6824 to 2e50087 Compare March 16, 2026 13:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR wires on-demand client assertion generation into the OidcClient token/PAR flows and ensures DPoP nonce retries can regenerate client assertions (avoiding stale/replayed assertions), with expanded tests and an updated console sample demonstrating the pattern.

Changes:

  • Pass ClientAssertionFactory into OIDC code exchange, refresh token, and PAR requests.
  • Regenerate client assertions on DPoP nonce retry inside ProofTokenMessageHandler.
  • Add a console sample ClientAssertionService and expand DPoP test coverage around assertion regeneration.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
identity-model-oidc-client/test/IdentityModel.OidcClient.Tests/DPoP/DPoPTests.cs Adds tests verifying client assertion refresh behavior on DPoP nonce retries and maintains backward-compat behavior without a factory.
identity-model-oidc-client/src/IdentityModel.OidcClient/ResponseProcessor.cs Adds ClientAssertionFactory to the authorization-code redemption request.
identity-model-oidc-client/src/IdentityModel.OidcClient/OidcClient.cs Uses Array.Empty/materialization tweaks and adds ClientAssertionFactory to refresh-token requests; minor null-safety/logging change.
identity-model-oidc-client/src/IdentityModel.OidcClient/IdentityModel.OidcClient.csproj Switches dependency from PackageReference to ProjectReference for IdentityModel.
identity-model-oidc-client/src/IdentityModel.OidcClient/AuthorizeClient.cs Adds ClientAssertionFactory to pushed authorization request.
identity-model-oidc-client/src/IdentityModel.OidcClient.Extensions/DPoP/ProofTokenMessageHandler.cs Regenerates client assertions on nonce retry by invoking a factory stored in HttpRequestMessage.Options.
identity-model-oidc-client/samples/NetCoreConsoleClient/src/NetCoreConsoleClient/Program.cs Updates sample to use DPoP plus a ClientAssertionFactory to ensure fresh assertions on retries.
identity-model-oidc-client/samples/NetCoreConsoleClient/src/NetCoreConsoleClient/NetCoreConsoleClient.csproj Enables implicit usings/nullable and updates dependencies to support new sample functionality.
identity-model-oidc-client/samples/NetCoreConsoleClient/src/NetCoreConsoleClient/ClientAssertionService.cs Adds helper to create private_key_jwt client assertions with fresh jti/iat per invocation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@Erwinvandervalk Erwinvandervalk force-pushed the fix/dpop-client-assertion-oidc-client branch from 2931129 to e46c3f6 Compare March 16, 2026 15:09
@Erwinvandervalk Erwinvandervalk added the area/foss/im-oidc-client Issues related to Identity Model OIDC Client label Mar 16, 2026
@Erwinvandervalk Erwinvandervalk self-assigned this Mar 16, 2026
…cClient.

Wire client assertion creator into OIDC code exchange flow.
Update DPoP ProofTokenMessageHandler to regenerate assertions on retry.
Add ClientAssertionService to NetCoreConsoleClient sample.
Expand DPoP test coverage for client assertion scenarios.

wip

cleanup
@Erwinvandervalk Erwinvandervalk force-pushed the fix/dpop-client-assertion-oidc-client branch from e46c3f6 to d233a68 Compare March 17, 2026 06:31
@Erwinvandervalk Erwinvandervalk merged commit b59919e into main Mar 17, 2026
16 checks passed
@Erwinvandervalk Erwinvandervalk deleted the fix/dpop-client-assertion-oidc-client branch March 17, 2026 07:34
@Erwinvandervalk Erwinvandervalk added this to the imoc-7.1.0 milestone Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/foss/im-oidc-client Issues related to Identity Model OIDC Client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants